package com.uinnova.springboot.demo.swagger;

import com.uinnova.springboot.demo.common.Groups;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * @author 张攀钦
 * @date 2018-12-27-23:45
 * ${DES}
 */
@Data
@ApiModel
public class Swagger implements Serializable {

    private static final long serialVersionUID = 6324749234920325532L;

    @ApiModelProperty(value = "主键标识", name = "id", notes = "数据库主键说明", dataType = "String", required = true, position = 1,
            hidden = false, example = "1123412")
    @NotBlank(message = "id 不能为空", groups = Groups.Insert.class)
    private String id;
    @ApiModelProperty(name = "name", value = "姓名", notes = "显示名称", dataType = "String", required = true, position = 2,
            hidden = false, example = "张攀钦")

    @NotBlank(message = "name 不能为空")
    @Length(min = 1, max = 12, message = "name 长度为[1,12]")
    private String name;
    @ApiModelProperty(name = "sex", value = "性别", notes = "性别", dataType = "String", required = true, position = 2,
            allowableValues = "男,女", hidden = false, example = "男")
    private String sex;
    @ApiModelProperty(name = "age", value = "年龄", notes = "年龄不能很小哦", dataType = "Integer", required = false, position = 3,
            allowableValues = "range[0,125]", hidden = false, example = "22")
    private Integer age;
    @ApiModelProperty(name = "money", value = "存款", notes = "很多的存款哦", dataType = "String", required = false, position = 5,
            hidden = true, example = "2222222222")
    private String money;

    @NotBlank(message = "日期不能为空")
    private String time;
}
